#pragma once
#include <d3d9.h>
#include "d3dUtil.h"

class Cube
{
private:
	struct sVertex
	{
		float x, y, z;
		float tx,ty,tz;
	};

	struct Position
	{
		float x, y, z;
	};

	IDirect3DDevice9 *Device;

	IDirect3DVertexBuffer9 * vBuffer;
	IDirect3DIndexBuffer9 * iBuffer;

	LPCTSTR textureFileName;
	LPDIRECT3DCUBETEXTURE9 cubeTexture;

	DWORD fvf;
	float size;

	Position pos;
	D3DXMATRIX World;

public:
	Cube(float _size, IDirect3DDevice9* device);
	~Cube(void);

	void onLostDevice();
	void onResetDevice();

	void LoadCubeTexture(LPCSTR fileName);
	void Render();

	void SetPosition(float x, float y, float z);
};

